package com.aikon.wht.service;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ResponseHandler;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

/**
 * @author haitao.wang
 */
public class CommonResponseHandler implements ResponseHandler<Object> {

    public String handleResponse(HttpResponse response) throws  IOException {
        HttpEntity httpEntity = response.getEntity();
        String html = EntityUtils.toString(httpEntity, "utf-8");
        return html;
    }

}